package com.homelock.controller;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.homelock.common.controller.BasicController;
import com.homelock.common.vo.PageReq;
import com.homelock.common.vo.PageResp;
import com.homelock.common.vo.Resp;
import com.homelock.service.DemoService;

@Controller
@RequestMapping("/demo")
public class DemoController extends BasicController{

	Logger logger = LoggerFactory.getLogger(DemoController.class);
	
	@Resource
	private DemoService demoService;
	
	@RequestMapping(value = "/pageList", method = RequestMethod.POST)
	@ResponseBody
	public Resp pageList(@RequestBody PageReq param) {
		try{
			PageResp result = demoService.pageList(param);
			return Resp.ok(result);
		}catch(Exception e){
			return Resp.faild("异常");
		}
	}
}
